<%
'CARGAR UN TXT A BD

Function aplica_altaenca()
Dim objFSO 
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
Const adLockReadOnly = 1
Const adLockPessimistic = 2
Const adLockOptimistic = 3
Set DataConn1 =Server.CreateObject ("ADODB.Connection")
'Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
set rs1=Server.CreateoBJECT("ADODB.recordset")
Set rs2=Server.CreateObject("ADODB.recordset")
'Set fs = CreateObject("Scripting.FileSystemObject")
'filename=server.mappath("/formatos/factura.txt")
'Set readfile=fs.OpenTextFile(filename,1,False)
'Set fs = CreateObject("Scripting.FileSystemObject")
'DataConn1.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/cgi-bin/controlsat.mdb"))
DataConn1.Open("empafish")
rs1.CursorType = adOpenKeyset
rs1.LockType = adLockOptimistic

 sqltxt="SELECT * FROM AllData_Query"
 rs1.open sqltxt,DataConn1

				sql="INSERT INTO allCases ( "
				sql=sql & "  "
				sql=sql & "  "
				sql=sql & " )"
				sql=sql & " VALUES(" & CAN_ORIG & ",'" & Apa & "','" & serie & "','" & cliente &  "','" & comercial & "'," &   pa & ",'" & fecha & "'," & impuesto & ",'" & articulo & "'," 
	count=count+1

loop
readfile.close
set readfile=nothing
set fs=nothing
rs1.close
set rs1=nothing
DataConn1.Close
Set DataConn1 = Nothing

response.write "<center><b>" & Count & " linea(s) fueron cargada(s)</b></center>"

end function
%>